<html xmlns="http://www.w3.org/1999/xhtml"
   xmlns:th="http://www.thymeleaf.org"
   xmlns:winter="http://www.winter.org">
<body>
	<div th:fragment="control">
		<winter:output id="CrearEditarControlOutput">
			<div id="NuevoControlContainer" class="form-container" th:if="${controles.context.control}">
			    <winter:row>
		    		<winter:column type="col-md-4">
		    	   		<winter:inputtext
							id="NuevaControlNro" 
							field="*{control.nrocontrol}"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text"
							label="#{label.control.nrocontrol}"
							disabled="true">
						</winter:inputtext>
		    	   </winter:column>
		    	   <winter:column type="col-md-4">
		    	   		<winter:datetimepicker
							id="FechaControl"
							label="#{label.control.fecha}"
							field="*{control.fecha}"
							format="DD/MM/YYYY">
						</winter:datetimepicker>
		    	   </winter:column>
		    	   <winter:column type="col-md-4">
		    	   		<winter:text
		    	   			id="NuevoControlEscribano" 
							label="#{label.control.escribano}" 
							text="${beans.systemInfo.escribano.persona.nombreCompleto}"
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							if="${beans.systemInfo.escribano}">
						</winter:text>
		    	   </winter:column>
		    	 </winter:row>
		    	 <winter:row>
		    	 	<winter:column type="col-md-4">
					  	<winter:inputtext
							id="NuevoControlOrden" 
							field="*{control.nroorden}" 
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text"
							label="#{label.control.nroorden}"
							maxlength="20">
						</winter:inputtext>	
					</winter:column>
					<winter:column type="col-md-4">
					  	<winter:select 
							id="NuevoselectEstado"
							field="*{control.estado}" 
							collection="est, rowEst : ${controles.estadosControl}"
							value="@{${est.id}+'|'+${est.descripcion}}"
							text="@{${est.descripcion}}"
							label="#{label.control.estado}"
							required="true"
							requiredmessage="Favor seleccione un Estado"
							modern="true"
							showglobalmessage="true">
						</winter:select>	
					</winter:column>
		    	   	<winter:column type="col-md-4">
					  	<winter:textarea
							id="NuevoControlDecripcion" 
							label="#{label.control.descripcion}"
							field="*{control.descripcion}" 
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize"
							maxlength="250"
							maxlengthmessage="Favor ingrese hasta 250 digitos">
						</winter:textarea>
					</winter:column>
		    	 </winter:row>
		    	 <winter:row>
		    	 	<winter:column type="col-md-4">
					  	<winter:textarea
							id="NuevoControlReferencia" 
							label="#{label.control.referencia}"
							field="*{control.referencia}" 
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize"
							maxlength="250"
							maxlengthmessage="Favor ingrese hasta 250 digitos">
						</winter:textarea>	
					</winter:column>
					<winter:column type="col-md-4">
		    	   		<winter:textarea
							id="NuevoControlConcepto" 
							label="#{label.control.concepto}"
							field="*{control.concepto}" 
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize"
							maxlength="250"
							maxlengthmessage="Favor ingrese hasta 250 digitos">
						</winter:textarea>
		    	   </winter:column>
		    	   <winter:column type="col-md-4">
		    	   		<winter:textarea
							id="NuevoControlObservacion" 
							label="#{label.control.observacion}"
							field="*{control.observacion}" 
							labeldisplay="col-xs-4"
							inputdisplay="col-xs-8"
							containerdisplay="row padded"
							class="winter-input-text capitalize"
							maxlength="250"
							maxlengthmessage="Favor ingrese hasta 250 digitos">
						</winter:textarea>
		    	   </winter:column>
		    	 </winter:row>
			</div>		
		</winter:output>
		<winter:output id="ControlesTabsOutput">
			<div id="ControlesTabsContainer">		
				<winter:tabs id="ControlesTabs">
					<winter:tab-item id="NaturalezaTab" title="Naturalezas">
					  	<div id="NaturalezasInclude" th:include="/admin/controlNaturaleza :: NaturalezaFragment">
						</div>
					</winter:tab-item>
					<winter:tab-item id="PersonaTab" title="Personas">
					  	<div id="PersonasInclude" th:include="/admin/controlPersona :: PersonaFragment">
						</div>
					</winter:tab-item>
					<winter:tab-item id="VehiculoTab" title="Vehiculos">
					  	<div id="VehiculosInclude" th:include="/admin/controlVehiculo :: VehiculoFragment">
						</div>
					</winter:tab-item>
					<winter:tab-item id="InmuebleTab" title="Inmuebles">
					  	<div id="InmueblesInclude" th:include="/admin/controlInmueble :: InmuebleFragment">
						</div>
					</winter:tab-item>
				</winter:tabs>		
			</div>
		</winter:output>
		<winter:output id="NaturalezasModalOutput">
		   	<div id="NuevoNaturalezaContainer" th:if="${controles.context.naturaleza}">
				<winter:dialog id="NaturalezasModal" width="80%" height="auto" title="@{'Naturaleza'}" resizable="true" contentClass="dialog-form" effect="fade-and-scale">
					<winter:output id="NaturalezasGestionOutput">
						<div id="NaturalezasGestionInclude" th:include="/admin/controlNaturalezaDialog :: NaturalezasGestionFragment">
						</div>
					</winter:output>
				</winter:dialog>
			</div>
		</winter:output>
		<winter:output id="PersonasModalOutput">
		   	<div id="NuevoPersonaContainer" th:if="${controles.context.persona}">
				<winter:dialog id="PersonasModal" width="80%" height="auto" title="@{'Persona'}" resizable="true" contentClass="dialog-form" effect="fade-and-scale">
					<winter:output id="PersonasGestionOutput">
						<div id="PersonasGestionInclude" th:include="/admin/controlPersonaDialog :: PersonasGestionFragment">
						</div>
					</winter:output>
				</winter:dialog>
			</div>
		</winter:output>
		<winter:output id="VehiculosModalOutput">
		   	<div id="NuevoVehiculoContainer" th:if="${controles.context.vehiculo}">
				<winter:dialog id="VehiculosModal" width="80%" height="auto" title="@{'Vehiculo'}" resizable="true" contentClass="dialog-form" effect="fade-and-scale">
					<winter:output id="VehiculosGestionOutput">
						<div id="VehiculosGestionInclude" th:include="/admin/controlVehiculoDialog :: VehiculosGestionFragment">
						</div>
					</winter:output>
				</winter:dialog>
			</div>
		</winter:output>
		<winter:output id="InmueblesModalOutput">
		   	<div id="NuevoInmuebleContainer" th:if="${controles.context.inmueble}">
				<winter:dialog id="InmueblesModal" width="80%" height="auto" title="@{'Inmueble'}" resizable="true" contentClass="dialog-form" effect="fade-and-scale">
					<winter:output id="InmueblesGestionOutput">
						<div id="InmueblesGestionInclude" th:include="/admin/controlInmuebleDialog :: InmueblesGestionFragment">
						</div>
					</winter:output>
				</winter:dialog>
			</div>
		</winter:output>
		<winter:row class="button-panel-right" padded="true">
			<winter:ajaxSubmit 
				id="CrearControl" 
				form="ControlesForm" 
				url="@{'/controles/guardarControl'}" 
				update="ControlesOutput, CrearEditarControlOutput"
				object="controles"
				value="#{label.operaciones.guardar}"
				showstatus="true"
				class="btn btn-cyan"
				process="CrearEditarControlOutput">
			</winter:ajaxSubmit>
			<winter:ajaxSubmit 
				id="CrearControlCancelar" 
				form="ControlesForm" 
				url="@{'/controles/cancelar/CONTROL'}"
				update="ControlesOutput"
				value="#{label.operaciones.cancelar}"
				showstatus="true"
				class="btn btn-danger"
				process="NuevoControlContainer"
				immediate="true">
			</winter:ajaxSubmit>
		</winter:row>				
	</div>
</body>
</html>